package com.cdjf.dao.emp;

import com.cdjf.dao.EmpDao;
import com.cdjf.pojo.Emp;
import com.cdjf.utils.XmlParserUtils;
import org.springframework.stereotype.Repository;
//import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Objects;

//@Component
@Repository("eDaoA")
public class EmpDaoA implements EmpDao {
    @Override
    public List<Emp> empList() {
        String file = Objects.requireNonNull(this.getClass().getClassLoader().getResource("emp.xml")).getFile();
        System.out.println(file);
        List<Emp> empList;
        empList = XmlParserUtils.parse(file, Emp.class);
        return empList;
    }
}
